<template>
    <el-dialog v-if="dialogVisible" :close-on-click-modal='false' title="网盘地址" :visible.sync="dialogVisible" @close="resetForm('viewShotPathRef')" width="400px">
        <el-form label-position="top" label-width="auto" size="medium" :hide-required-asterisk='true' :model="viewShotPathForm" :rules="viewShotPathRules" ref="viewShotPathRef" v-loading="loading">
            <el-form-item label="" prop="material_addr">
                <el-input type="textarea" :rows="3" placeholder="请输入网盘地址" v-model="viewShotPathForm.material_addr">
                </el-input>
            </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
            <el-button @click="resetForm('viewShotPathRef')" class="el-button-width" size="small">取 消</el-button>
            <el-button type="primary" @click="resetForm('viewShotPathRef')" class="el-button-width" size="small" :disabled='disabled' :loading="disabled">确 定</el-button>
        </span>
    </el-dialog>
</template>

<script>
export default {
    name: "",
    data() {
        return {
            disabled: false,
            dialogVisible: false,
            viewShotPathForm: {
                material_addr: "",
            },
            viewShotPathRules: {
                material_addr: [
                    {
                        required: true,
                        message: "请选择网盘地址",
                        trigger: "blur",
                    },
                ],
            },
        };
    },

    created() {
        this.$bus.on("viewShotPath", (value) => {
            this.viewShotPathForm.material_addr = value.material_addr
            this.dialogVisible = value.dialogVsb;
        });
    },
    beforeDestroy() {
        this.$bus.off("viewShotPath");
    },
    methods: {

        // 关闭重置表单
        resetForm(formName) {
            this.$refs[formName].resetFields();
            this.dialogVisible = false;
        },
    },
};
</script>
<style scoped>

</style>

